/*
 *
 * Copyright (C) 2012 Walter Lütgenau
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * 
 */
package offset.nodes.server.view.list;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;

/**
 *
 * @author Walter L�tgenau
 */
public class BeforeUpdateModelListManager extends AbstractListManager implements ListManager {
    Pager pager = new BeforeUpdateModelPager();
    PageableList list = new BeforeUpdateModelList();

    public class BeforeUpdateModelList implements PageableList {
        int pageStart = 0;

        @Override
        public int getPageSize() {
            throw new UnsupportedOperationException("Not supported yet.");
        }

        @Override
        public int getPageStart() {
            return pageStart;
        }

        @Override
        public int getTotalSize() {
            throw new UnsupportedOperationException("Not supported yet.");
        }

        @Override
        public void setPageSize(int size) {
            throw new UnsupportedOperationException("Not supported yet.");
        }

        @Override
        public void setPageStart(int index) {
            this.pageStart = index;
        }

        @Override
        public boolean add(Object e) {
            throw new UnsupportedOperationException("Not supported yet.");
        }

        @Override
        public void add(int index, Object element) {
            throw new UnsupportedOperationException("Not supported yet.");
        }

        @Override
        public boolean addAll(Collection c) {
            throw new UnsupportedOperationException("Not supported yet.");
        }

        @Override
        public boolean addAll(int index, Collection c) {
            throw new UnsupportedOperationException("Not supported yet.");
        }

        @Override
        public void clear() {
            throw new UnsupportedOperationException("Not supported yet.");
        }

        @Override
        public boolean contains(Object o) {
            throw new UnsupportedOperationException("Not supported yet.");
        }

        @Override
        public boolean containsAll(Collection c) {
            throw new UnsupportedOperationException("Not supported yet.");
        }

        @Override
        public Object get(int index) {
            throw new UnsupportedOperationException("Not supported yet.");
        }

        @Override
        public int indexOf(Object o) {
            throw new UnsupportedOperationException("Not supported yet.");
        }

        @Override
        public boolean isEmpty() {
            throw new UnsupportedOperationException("Not supported yet.");
        }

        @Override
        public Iterator iterator() {
            throw new UnsupportedOperationException("Not supported yet.");
        }

        @Override
        public int lastIndexOf(Object o) {
            throw new UnsupportedOperationException("Not supported yet.");
        }

        @Override
        public ListIterator listIterator() {
            throw new UnsupportedOperationException("Not supported yet.");
        }

        @Override
        public ListIterator listIterator(int index) {
            throw new UnsupportedOperationException("Not supported yet.");
        }

        @Override
        public boolean remove(Object o) {
            throw new UnsupportedOperationException("Not supported yet.");
        }

        @Override
        public Object remove(int index) {
            throw new UnsupportedOperationException("Not supported yet.");
        }

        @Override
        public boolean removeAll(Collection c) {
            throw new UnsupportedOperationException("Not supported yet.");
        }

        @Override
        public boolean retainAll(Collection c) {
            throw new UnsupportedOperationException("Not supported yet.");
        }

        @Override
        public Object set(int index, Object element) {
            throw new UnsupportedOperationException("Not supported yet.");
        }

        @Override
        public int size() {
            throw new UnsupportedOperationException("Not supported yet.");
        }

        @Override
        public List subList(int fromIndex, int toIndex) {
            throw new UnsupportedOperationException("Not supported yet.");
        }

        @Override
        public Object[] toArray() {
            throw new UnsupportedOperationException("Not supported yet.");
        }

        @Override
        public Object[] toArray(Object[] a) {
            throw new UnsupportedOperationException("Not supported yet.");
        }

    }

    public class BeforeUpdateModelPager implements Pager {
        PagingCommand command = PagingCommand.none;

        @Override
        public void first() {
            this.command = PagingCommand.first;
        }

        @Override
        public int getPageSize() {
            throw new UnsupportedOperationException("Not supported yet.");
        }

        @Override
        public boolean isPagingRequired() {
            return true;
        }

        @Override
        public void last() {
            this.command = PagingCommand.last;
        }

        @Override
        public void next() {
            this.command = PagingCommand.next;
        }

        @Override
        public void previous() {
            this.command = PagingCommand.previous;
        }

        @Override
        public void setPageSize(int size) {
            throw new UnsupportedOperationException("Not supported yet.");
        }

        @Override
        public PageableList getList() {
            return new BeforeUpdateModelList();
        }

    }

    @Override
    public Pager getPager() {
        return pager;
    }

    @Override
    public List getResult() {
        return new ArrayList();
    }

    @Override
    public boolean isNotEmpty() {
        return true;
    }

}
